<?php

class Application_Form_Filtro extends Zend_Form
{

    public function init()
    {   

    	$objLista = new Application_Model_Lista();
    	
        $this->setName('form_filtro');
        $this->setAction('');
        $this->setMethod('post');
        
        $criar = new Zend_Form_Element_Submit('Cadastrar');
        $criar->setAttribs(array('title'=>'Cadastrar filtro', 'style'=>'font-weight:bold;'));
 		
        $lista = new Zend_Form_Element_Select('Lista');
        $lista->addMultiOptions($objLista->fetchPair())
       		  ->setLabel('Lista:')
       		  ->setAttribs(array('id'=>'filtro-add'));
        	   
        $nome = new Zend_Form_Element_Text('Nome');        
        $nome->setAttribs(array('size'=>'50'))
        	  ->setLabel('Nome:')
        	   ->setRequired(true);

       $this->addElements(array($nome,$lista,$criar));
       
       //DECORADORES
       $this->clearDecorators();
       $this->addDecorator('FormElements')
         	 ->addDecorator('HtmlTag', array('tag' => '<table>', 'cellpadding'=>'0', 'cellspacing'=>'1','align'=>'right','width'=>'700px'))
             ->addDecorator('Form');
        
       $this->setElementDecorators(array(
            array('ViewHelper'),
            array('Errors'),
            array('Description'),
            array(array('dados'=>'HtmlTag'),array('tag'=>'td')),
            array('Label', array('separator'=>'','tag'=>'td'))        
            
        ));
      
    }
}

